package ma.cdm.compteRendu.bo;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * PersonneRoleId entity. @author Limouri Anouar
 */
@Embeddable

public class PersonneRoleId  implements java.io.Serializable {

	// Fields

	private Long idcomite;
	private String matricule;
	private Long idrole;

	// Constructors

	/** default constructor */
	public PersonneRoleId() {
	}

	/** full constructor */
	public PersonneRoleId(Long idcomite, String matricule, Long idrole) {
		this.idcomite = idcomite;
		this.matricule = matricule;
		this.idrole = idrole;
	}

	// Property accessors

	@Column(name = "IDCOMITE", nullable = false)
	public Long getIdcomite() {
		return this.idcomite;
	}

	public void setIdcomite(Long idcomite) {
		this.idcomite = idcomite;
	}

	@Column(name = "MATRICULE", nullable = false, length = 20)
	public String getMatricule() {
		return this.matricule;
	}

	public void setMatricule(String matricule) {
		this.matricule = matricule;
	}

	@Column(name = "IDROLE", nullable = false)
	public Long getIdrole() {
		return this.idrole;
	}

	public void setIdrole(Long idrole) {
		this.idrole = idrole;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof PersonneRoleId))
			return false;
		PersonneRoleId castOther = (PersonneRoleId) other;

		return ((this.getIdcomite() == castOther.getIdcomite()) || (this
				.getIdcomite() != null && castOther.getIdcomite() != null && this
				.getIdcomite().equals(castOther.getIdcomite())))
				&& ((this.getMatricule() == castOther.getMatricule()) || (this
						.getMatricule() != null
						&& castOther.getMatricule() != null && this
						.getMatricule().equals(castOther.getMatricule())))
				&& ((this.getIdrole() == castOther.getIdrole()) || (this
						.getIdrole() != null && castOther.getIdrole() != null && this
						.getIdrole().equals(castOther.getIdrole())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getIdcomite() == null ? 0 : this.getIdcomite().hashCode());
		result = 37 * result
				+ (getMatricule() == null ? 0 : this.getMatricule().hashCode());
		result = 37 * result
				+ (getIdrole() == null ? 0 : this.getIdrole().hashCode());
		return result;
	}

}